<template>
  <div>
    <h2>用户列表页面</h2>
    <table class="table table-bordered">
      <thead>
        <tr>
          <td>账号</td>
          <td>注册时间</td>
        </tr>
      </thead>
      <tbody>
        <tr v-for="a in sdate">
          <td>{{ a.U_Name }}</td>
          <td>
            {{ a.U_Time.substring(0, 10) }}&nbsp;{{
              a.U_Time.substring(11, 19)
            }}
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script setup lang="ts">
import { reactive, toRefs, onMounted } from 'vue';
import axios from 'axios';
import { useRouter, useRoute } from 'vue-router';
let router = useRouter();
let route = useRoute();

let data: any = reactive({
  sdate: {},
});

let { sdate } = toRefs(data);

onMounted(() => {
  Show();
});

const Show = () => {
  axios({
    url: 'http://localhost:64124/api/Text01/GetUserShow',
    method: 'get',
  })
    .then((res) => {
      console.log(res);

      sdate.value = res.data.data;
    })
    .catch((err) => {
      console.log(err);
    });
};
</script>

<style scoped></style>
